package com.dao;

import com.pojo.Dep;
import com.pojo.Emp;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface EmpDAO extends JpaRepository<Emp,Long> {

      //@Query("from Emp e join fetch e.dep")
      //public List findAll();


      public List findByNameLike(String name);

      //sql不跨平台
      @Query(value="select * from emp where name like ?",nativeQuery=true)
      public List findByNameLike2(String name);

      //jpql  1.表名改类名  2.字段名改属性名
      @Query("select id,name from com.pojo.Emp where name like ?1")
      public List findByNameLike3(String name);
}
